  <div class="col-auto">
    <table>
      <tr>
        <td style="padding: 0 0.5em">
          <label class="control-label">Next Sunrise/Sunset at Geolocation</label>
          <div>
            {% if 'sunrise' in sunrise_set_calc[each_function.unique_id] and
                  sunrise_set_calc[each_function.unique_id]['sunrise'] and
                  'sunset' in sunrise_set_calc[each_function.unique_id] and
                  sunrise_set_calc[each_function.unique_id]['sunset'] %}
              Rise: {{sunrise_set_calc[each_function.unique_id]['sunrise']}}<br/>
              Set: {{sunrise_set_calc[each_function.unique_id]['sunset']}}
            {% else %}
              Could not calculate sunrise/sunset times
            {% endif %}
          </div>
        </td>
        <td style="padding: 0 0.5em">
          <label class="control-label">Next Sunrise/Sunset with Offsets</label>
          <div>
            {% if 'offset_sunrise' in sunrise_set_calc[each_function.unique_id] and
                  sunrise_set_calc[each_function.unique_id]['offset_sunrise'] and
                  'offset_sunset' in sunrise_set_calc[each_function.unique_id] and
                  sunrise_set_calc[each_function.unique_id]['offset_sunset'] %}
              Rise: {{sunrise_set_calc[each_function.unique_id]['offset_sunrise']}}<br/>
              Set: {{sunrise_set_calc[each_function.unique_id]['offset_sunset']}}
            {% else %}
              Could not calculate sunrise/sunset times
            {% endif %}
          </div>
        </td>
      </tr>
    </table>
  </div>
</div>

<div class="row small-gutters" style="border-bottom: 2px solid #ddd; padding-bottom: 0.2em">
<div class="col-10 col-sm-3 col-md-2">
  {{form_trigger.rise_or_set.label(class_='control-label')}}
  <div>
    <select class="form-control form-tooltip form-dropdown" data-placement="top" id="rise_or_set" name="rise_or_set" title="{{_('Trigger conditional at sunrise or sunset?')}}">
      <option value="sunrise"{% if each_function.rise_or_set == 'sunrise' %} selected{% endif %}>{{_('Sunrise')}}</option>
      <option value="sunset"{% if each_function.rise_or_set == 'sunset' %} selected{% endif %}>{{_('Sunset')}}</option>
    </select>
  </div>
</div>
<div class="col-auto">
  {{form_trigger.latitude.label(class_='control-label')}}
  <div>
    {{form_trigger.latitude(class_='form-control', value=each_function.latitude, **{'title':_('Latitude for sunrise or sunset')})}}
  </div>
</div>
<div class="col-auto">
  {{form_trigger.longitude.label(class_='control-label')}}
  <div>
    {{form_trigger.longitude(class_='form-control', value=each_function.longitude, **{'title':_('Longitude for sunrise or sunset')})}}
  </div>
</div>
<div class="col-auto">
  {{form_trigger.date_offset_days.label(class_='control-label')}}
  <div>
    {{form_trigger.date_offset_days(class_='form-control', value=each_function.date_offset_days, **{'title':_('The number of days to offset from the date of the sunrise or sunset')})}}
  </div>
</div>
<div class="col-auto">
  {{form_trigger.time_offset_minutes.label(class_='control-label')}}
  <div>
    {{form_trigger.time_offset_minutes(class_='form-control', value=each_function.time_offset_minutes, **{'title':_('The number of minutes to offset from the sunrise or sunset')})}}
  </div>
</div>
